# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=spectral
pkgver=0.0.0.854_git20200729
#_pkgver=${pkgver##*.}
pkgrel=0
_commit="d6009479a5cea4a9b5abcfacaa205eb9c8bf851c"
_commit_sortfilterproxymodel="36befddf5d57faad990e72c88c5844794f274145"
# Blocked on armhf by qt5-qtdeclarative
# Broken on s390x and mips
pkgdesc="A glossy cross-platform Matrix client"
arch="all !armhf !s390x !mips !mips64"
url="https://gitlab.com/spectral-im/spectral"
license="GPL-3.0-or-later"
depends="dbus:org.freedesktop.Secrets qt5-qtquickcontrols2"
makedepends="cmake qt5-qtbase-dev qt5-qtdeclarative-dev qt5-qtmultimedia-dev
	qt5-qtsvg-dev qt5-qtquickcontrols2-dev qt5-qtkeychain-dev libqtolm-dev
	olm-dev libsecret-dev cmark-dev libquotient-dev"
source="https://gitlab.com/spectral-im/spectral/-/archive/$_commit/spectral-$_commit.tar.gz
	SortFilterProxyModel-$_commit_sortfilterproxymodel.tar.gz::https://github.com/oKcerG/SortFilterProxyModel/archive/$_commit_sortfilterproxymodel.tar.gz"
options="!check" # No tests
builddir="$srcdir/$pkgname-$_commit"

prepare() {
	default_prepare

	rmdir include/SortFilterProxyModel
	mv "$srcdir"/SortFilterProxyModel-$_commit_sortfilterproxymodel include/SortFilterProxyModel
}

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="196c7935a7308beff1e1d0a1c0fca236a99695aacbb004b77b4948045666e88600cfb7558093b76f7f558163c2b023e787848a54b9151c563d3f061fbc5ecba4  spectral-d6009479a5cea4a9b5abcfacaa205eb9c8bf851c.tar.gz
bfb7af36abd5ded014549042e760c1ec6779f46dd6c30e672ada21decc7a1b1a631ada1cc2c57d62d0daca4cccff9640077345b3661ef73021d5e2ee8058ae9b  SortFilterProxyModel-36befddf5d57faad990e72c88c5844794f274145.tar.gz"
